package com.spark.authapi.feign;

import com.spark.authapi.feign.fallback.OauthFallBack;
import com.spark.basecommon.api.R;
import com.spark.basecommon.entity.vo.Oauth2TokenDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

import java.security.Principal;
import java.util.Map;

/**
 * @author fuqiang
 * @Description 授权api
 * @Date 2020/10/16
 */
@FeignClient(value = "auth-center" ,fallbackFactory = OauthFallBack.class)
public interface OauthFeign {
    /**
     * 授权认证 获取token
     * @param principal
     * @param parameters
     * @return
     */
    R<Oauth2TokenDto> authorization(@RequestBody Principal principal, @ApiIgnore @RequestParam Map<String, String> parameters);
}
